<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <title>信智联——技术开源分享博客</title>
    <meta itemprop="name" content="信智联——技术开源分享博客">
    <meta itemprop="image" content="logo_s.png">
    <meta name="description" itemprop="description" content="技术开源分享博客">
    <meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=no">

    <script type="text/javascript" charset="utf-8" src="./html_files/saved_resource"></script>
    <style>
        body, h1, h2, h3, h4, h5, h6, hr, p, blockquote,dl, dt, dd, ul, ol, li, fieldset, form, lengend, button, input, textarea,th, td {
     margin: 0; padding: 0
   }
   body {
    font-family: "Segoe UI ", "Lucida Grande ",Helvetica,Arial, "Microsoft YaHei ","FreeSans","Arimo", "Droid Sans", "wenquanyi micro hei ", "Hiragino Sans GB ", "Hiragino Sans GB W3 ", "FontAwesome ",sans-serif;
    text-align:center;
  }
  ul,ol {
    list-style:none;
  }
  img {
    border: 0;
  }
  li {
    list-style: none;
    display: list-item;
    text-align: -webkit-match-parent;
  }
  #wraper {
    margin: 0px auto 0px auto;
    position: relative;
    margin:0 auto; 
    width:70%;
    text-align:left;
  }
  .mainBody {
    width:100%;
  }
  .tit a {
    text-decoration: none;
  }
  .post-list {
    float: left;
    margin-right: 30px;
    display: inline-block;
    margin-top: 20px;
    width: 100%;/*320px    */
  }
  .last {
    margin-right: 0;
  }
  body {
   font: 12px/1.75 "宋体","Arial",sans-serif;
   background-color: #F2F2F2;
   color: #000;
   -webkit-text-size-adjust: 100%;
   overflow-x:hidden;
 }
 #details li.targetinfo {
  float: left;
  width:30%;
  max-width: 320px;
  margin: 10px;

  padding: 0;
  border: 0px solid #e6e6e6;
  box-shadow: 0 1px 3px 0 rgba(55, 55, 55, 0.33);
  background: #ffffff;
  overflow: hidden;
  _border: 1px solid #e6e6e6;
  border: 1px solid #e6e6e6\9;
  border: 1px solid #e6e6e6\9\0;
}
#details .post-title a {
  display: inline-block;
}

#details .post-title img {
  min-width: 100%;
  border-radius: 3px 3px 0 0;
  _width: 318px;
  width: 318px\9;
  width: 320px\9\0;
  height: 200px;
}

#details .post-title .tit {
 font-size: 14px;
 padding: 6px 14px 5px;
}
#details .post-title .tit a.num {
 display: inline-block;
 padding-left: 0px;
 font-size: 12px;
 color: #808080;
 font-weight: normal;
}
#details hr {
  border:0;
  background-color:#d9d9d9;
  height:1px;
}
#details .targetpost {
  margin-top: 0px;
  overflow: hidden;
}
#details li.post {
  padding: 8px 0 0 0;
  margin-top: 0px;
  border-top: 0px solid #e6e6e6;
  border-bottom: none;
  position: relative;
  zoom: 1;
}
#details li.post .post-content .avatar img {
  border-radius: 5px;
  width: 25px;
  height: 25px;
}
#details .post-body {
 padding-left: 0;
}
#details .post-message-container {
 padding: 0px 14px 2px;
 overflow: hidden;
}
#details .headImg {
  float: left;
  height: 24px;
  margin-right: 10px;
  border-radius: 4px;
}
#details .headImg img {
  border-radius: 14px;
  width: 24px;
  height: 24px;
}
#details .post-content .publisher {
  font-size: 12px;
  color: #5788aa;
}

.my-comments .time, .uptime0, .uptime {
  color: #999;
  font-size: 12px;
  font-color: #cccccc;
  display: inline-block;
  float: right;

}
#details .post-footer {
  padding: 2px 14px 12px;
  _padding: 5px 14px 2px;
  width: auto;
}
#details .post-footer .upvote {
  margin-right: 24px;
}
#details .post-footer span {
 color: #cccccc;
 cursor: pointer;
 font-size: 12px;
}
a.replyy:hover {
 background-position: 0px -95px;
 text-decoration: none;
 color: #808080;
}
.upvote a:hover, .upvote a span:hover {
 background-position: -125px 0px;
 text-decoration: none;
 color: #F14F38;
}
.upvote .upvoted {
  text-decoration: none;
  color: #F14F38;
}
.upvote .upvoted span {
  background-position: -125px 0px;
}
a.replyy, a.replyy:visited {
 color: #999999;
 text-decoration: none;
}
.avatar {
 display: none;
}
.upvote i, .upvote em {
  font-style: normal;
  text-decoration: none;
}
.replyy {
 margin-left: 10px;
}
.upvote a, .upvote span {
 padding: 2px 0px 3px 3px;
 background-position: 0px 0px;
 text-decoration: none;
}
.upvote a, .upvote span, .reply a, .upvote:hover, .reply span {
 font-size: 12px;
 font-color: red;
 color: #808080;
 cursor: pointer;
}
.upvote a span {
  padding: 2px 0px 3px 18px;
  background: url(./html_files/actionpg2.png) -99px 0px no-repeat;
}
#details .targetpost:after {
  content: ".";
  display: block;
  height: 0;
  clear: both;
  visibility: hidden;
}
#preBody {
/*  height :138px;*/
  width: 100%;
  background-color : #333333;
}
.tit #topic_title {
  color: #333333;
  font-size: 18px;
  font-family: "黑体";
  line-height: 28px;
}
.tit #topic_title:hover {
  color: #0079cd;
  text-decoration:underline;
}
.post-message-container em {
  color: #666666;
  font-size: 12px;
  font-family: "宋体";
  font-style: inherit;
  line-height: 24px;
}
#details .post-title .tit a.la2 {
 background-position: 4px -23px;
 font-size: 12px;
 font-family: "宋体";
 color: #999999;
}
.scrollBtn {
  position: fixed;
  margin-left: 1050px;
  margin-top: 623px;
}
.scrollBtn li {
 backgroud-color:#ffffff;
 margin-top: -6px;
 float:left;
}
#scroll-reload:hover {
 background: url(./html_files/reload2_hover.png) no-repeat;
}
#scroll-reload {
 background: url(./html_files/reload2.png) no-repeat;
 width: 54px;
 height: 54px;
 display: block;
}
#scroll-up:hover {
 background: url(./html_files/up2_hover.png) no-repeat;
}
#scroll-up {
 background: url(./html_files/up2.png) no-repeat;
 width: 54px;
 height: 54px;
 display: block;
}
#preLogo {
 padding-top: 10px;
 padding-bottom: 10px;
 text-align:center;
}
.cyWallImageShade img {
  max-width: 100%;
  max-height: 100%;
  position: absolute;
  bottom: 0px;
  display: block;
}

.footer{
  border-top: 1px solid #ededed;
  clear:both;
  height:50px;
  line-height: 50px;
  text-align: center;
}
</style>
</head>

<body>
    <div id="preBody">
        <div id="preLogo"><a id="homePage" href="index.html"><img src="logo.png" height="48px"></a></div>
    </div>
    <div id="wraper">
        <div id="mainBody" style="padding-bottom:0px">
            <!-- 全局 -->
            <div id="globalParam"></div>
            <!-- 列表start -->
            <div id="mainContent">
                <div id="allComments">
                    <h1></h1>
                    <h3></h3>
                    <div id="details">

                        <iframe id="olfile" width="100%" height="600px" frameborder="0">这是嵌入文档，由Office Online支持。
                        </iframe>

                        <hr>
                        <!--PC和WAP自适应版-->
                        <div id="SOHUCS" sid="main"></div>
                        <script type="text/javascript">
                            (function() {
                                var appid = 'cytftPjgm';
                                var conf = 'prod_c36c7bd9b2f06392545d45958b7808e2';
                                var width = window.innerWidth || document.documentElement.clientWidth;
                                if (width < 960) {
                                    window.document.write('<script id="changyan_mobile_js" charset="utf-8" type="text/javascript" src="https://changyan.sohu.com/upload/mobile/wap-js/changyan_mobile.js?client_id=' + appid + '&conf=' + conf + '"><\/script>');
                                } else {
                                    var loadJs = function(d, a) {
                                        var c = document.getElementsByTagName("head")[0] || document.head || document.documentElement;
                                        var b = document.createElement("script");
                                        b.setAttribute("type", "text/javascript");
                                        b.setAttribute("charset", "UTF-8");
                                        b.setAttribute("src", d);
                                        if (typeof a === "function") {
                                            if (window.attachEvent) {
                                                b.onreadystatechange = function() {
                                                    var e = b.readyState;
                                                    if (e === "loaded" || e === "complete") {
                                                        b.onreadystatechange = null;
                                                        a()
                                                    }
                                                }
                                            } else {
                                                b.onload = a
                                            }
                                        }
                                        c.appendChild(b)
                                    };
                                    loadJs("https://changyan.sohu.com/upload/changyan.js", function() {
                                        window.changyan.api.config({
                                            appid: appid,
                                            conf: conf
                                        })
                                    });
                                }
                            })();

                        </script>

                    </div>
                </div>
            </div>




            <div class="scrollBtn">
                <ul>
                    <li><a id="scroll-up" href="javascript:void(0)" style="display: none;"></a></li>
                    <li><a id="scroll-reload" href="javascript:void(0)"></a></li>
                </ul>
            </div>
        </div>
    </div>
    <!--
    <div class="cyWallImageShade" style="display: block; opacity: 0.8; position: absolute; top: 0px; left: 0px; height: 0px; width: 0px; background-color: rgb(0, 0, 0);">
      <a id="cyWallImageShadeUrl" target="_blank" href="javascript:void(0)">
        <img src="./html_files/changyan_title.png" style="height: 33px; width: 146px; opacity: 1; position: absolute; margin: 90px 97px;">
      </a>
    </div>
-->







    <div class="footer">
        Copyright© 2016 50W LAB 版权所有. 陇ICP备17000993号-1
    </div>

    <script>
        jQuery("#scroll-up").hide();
        jQuery(".cyWallImageShade").hide();
        var client_id = "cy2ze4uTECnJ";
        var moreUrl = "http://changyan.sohu.com/api/labs/hotnewswall/more?client_id=cy2ze4uTECnJ";
        var actionUrl = "http://changyan.sohu.com/api/2/comment/action?action_type=1";
        var total = 0;
        var pos = 0;
        load(pos, 30);
        if (client_id == "cyr5xHgCU") {
            $("#preBody").hide();
        }
        $(window).bind("scroll", function() {
            if ($(document).scrollTop() + $(window).height() > $(document).height() - 20) {
                if (pos < total) {
                    if (pos + 30 > total) {
                        load(pos, total);
                        pos = total;
                    } else {
                        load(pos, pos + 30);
                    }
                }
            }
            if ($(document).scrollTop() > 800) {
                jQuery("#scroll-up").show();
            }
        });
        jQuery(".post-list").on("click", ".upvote a", function() {
            var name = $(this).attr('class');
            if (name != "upvoted") {
                var count = $(this).children("em").text();
                $(this).children("em").text(++count)
                $(this).addClass("upvoted");
                $(this).children("i").text("已顶");
                jQuery.ajax({
                    'type': 'GET',
                    'url': actionUrl,
                    'data': {
                        'client_id': client_id,
                        'topic_id': $(this).data("tid"),
                        'comment_id': $(this).data("cid")
                    },
                    'dataType': 'jsonp',
                    'scriptCharset': 'utf-8'
                });
            }
        });
        jQuery("#scroll-reload").on("click", function() {
            window.location.reload();
        });
        jQuery("#scroll-up").on("click", function() {
            $(window).scrollTop(0);
            jQuery("#scroll-up").hide();
        });
        jQuery(".post-list").on("mouseover", ".post-image", function() {
            var obj = jQuery(".cyWallImageShade");
            var h = $(this).height();
            var w = $(this).width();
            obj.css("top", $(this).offset().top);
            obj.css("left", $(this).offset().left);
            obj.css({
                "height": h,
                "width": w,
                "background-color": "#000000",
                "opacity": "0.8",
                "position": "absolute"
            });
            var img = jQuery(".cyWallImageShade img");
            img.css({
                "height": "33px",
                "width": "146px",
                "opacity": "1",
                "position": "absolute",
                "margin": "98px 97px"
            });
            jQuery("#cyWallImageShadeUrl").data("url", $(this).data("url"));
            obj.show();
        });
        jQuery("#cyWallImageShadeUrl").on("click", function() {
            stat("labshotnewswallClick");
            var u = jQuery(this).data("url");
            window.open(u);
        });
        jQuery(".cyWallImageShade").on("mouseleave", function() {
            var obj = jQuery(".cyWallImageShade");
            obj.css({
                "top": 0,
                "left": 0,
                "height": 0,
                "width": 0
            });
            var img = jQuery(".cyWallImageShade img");
            img.css({
                "height": "33px",
                "width": "146px",
                "opacity": "1",
                "position": "absolute",
                "margin": "90px 97px"
            });
        });
        jQuery(".post-list").on("mouseover", ".upvote a", function() {
            $(this).children("span").css("background-position", "-125px 0px");
        });
        jQuery(".post-list").on("mouseleave", ".upvote a", function() {
            $(this).children("span").css("background-position", "-99px 0px");
        });

        function load(start, end) {
            pos = end;
            jQuery.ajax({
                'type': 'GET',
                'url': moreUrl,
                'data': {
                    'start': start,
                    'end': end
                },
                'success': function(data) {
                    jQuery('#row1').append(data.list1Html);
                    jQuery('#row2').append(data.list2Html);
                    jQuery('#row3').append(data.list3Html);
                    total = data.totalCount;
                },
                'dataType': 'json',
                'scriptCharset': 'utf-8'
            });
        }
        stat("labshotnewswall");

        function stat(type) {
            jQuery.ajax({
                'type': 'GET',
                'url': 'https://changyan.sohu.com/stat/event',
                'data': {
                    'clientid': client_id,
                    'type': type
                },
                'success': function() {},
                'dataType': 'jsonp',
                'scriptCharset': 'utf-8'
            });
        }

        function IsPC() {
            var userAgentInfo = navigator.userAgent;
            var Agents = ["Android", "iPhone",
                "SymbianOS", "Windows Phone",
                "iPad", "iPod"
            ];
            var flag = true;
            for (var v = 0; v < Agents.length; v++) {
                if (userAgentInfo.indexOf(Agents[v]) > 0) {
                    flag = false;
                    break;
                }
            }
            return flag;
        }


        /*--------------------实现2(返回 $_GET 对象, 仿PHP模式)----------------------*/
        var $_GET = (function() {
            var url = window.document.location.href.toString();
            var u = url.split("?");
            if (typeof(u[1]) == "string") {
                u = u[1].split("&");
                var get = {};
                for (var i in u) {
                    var j = u[i].split("=");
                    get[j[0]] = j[1];
                }
                return get;
            } else {
                return {};
            }
        })();
        //format
        String.prototype.format = function(args) {
            if (arguments.length > 0) {
                var result = this;
                if (arguments.length == 1 && typeof(args) == "object") {
                    for (var key in args) {
                        var reg = new RegExp("({" + key + "})", "g");
                        result = result.replace(reg, args[key]);
                    }
                } else {
                    for (var i = 0; i < arguments.length; i++) {
                        if (arguments[i] == undefined) {
                            return "";
                        } else {
                            var reg = new RegExp("({[" + i + "]})", "g");
                            result = result.replace(reg, arguments[i]);
                        }
                    }
                }
                return result;
            } else {
                return this;
            }
        }


        //ready
        $(document).ready(function() {
            console.log("IsPC:" + IsPC());
            if (!IsPC()) {
                $("#wraper").css("width", "100%");
            }
            console.log("Window width:" + $(window).width());
            if ($(window).width() < 850) {
                $("#wraper").css("width", "100%");
            }
            if ($(window).width() < 730 || !IsPC()) {
                $(".targetinfo").css("float", "none");
                $(".targetinfo").css("width", "100%");
                $(".targetinfo").css("max-width", "100%");
                $(".post-image").css("height", "auto");
                $(".post-image").css("width", "100%");
            }

            //加载file
            var officeUrl = 'https://view.officeapps.live.com/op/embed.aspx?src={0}&wdStartOn=1';
            officeUrl = officeUrl.format($_GET['file']);
            //console.log(officeUrl);
            //console.log($_GET['file']);
            //alert($(window).height()-200);
            //$("#wraper").attr("width", $(document).width());
            //$("#olfile").attr("width", $(document).width());
            $("#olfile").attr("height", $(document).height() - 200);
            $("#olfile").attr("src", officeUrl);

            //ui
            $("title").text(decodeURIComponent($_GET['h1']));
            $("h1").html(decodeURIComponent($_GET['h1']) + ' <a href="' + decodeURIComponent($_GET['file']) + '">[下载]</a>')
            $("h3").text(decodeURIComponent($_GET['h2']));

            //加载评论
            $("#SOHUCS").attr("sid", decodeURIComponent($_GET['h1']));
        });

    </script>

</body>

</html>
